package day05;

import java.util.Arrays;

public class ArrayCopyDemo {
    public static void main(String[] args) {
        int [] a = {10,20,30,40,50};
        int [] b = new int[6];

//        System.arraycopy(a,1,b,1,4);
//        for(int i=0;i<b.length;i++){
//            System.out.println(b[i]);
//        }

        int [] c =Arrays.copyOf(a,4);
        for(int i=0;i<c.length;i++){
            System.out.println(c[i]);
        }

//        a= Arrays.copyOf(a,a.length+1);
//        a[a.length-1] = 60;
//        for(int i=0;i<a.length;i++){
//            System.out.println(a[i]);
//        }
    }
}
